import datetime
from app.db.models.asset_tasks import AssetTasks


class OtherAssetTaskStatus:

    def service(self, task_group_type):
        """
        更新任务状态
        """
        print(f"{datetime.datetime.now()}  开始更新任务运行状态......")
        asset_tasks = AssetTasks.objects.find({"status": "unknown"})
        for asset_task in asset_tasks:
            asset_task.update_status()
        print(f"{datetime.datetime.now()}  更新结束")
